package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.easyflow;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author zzp
 * @date 2021/11/25
 * flowable流程流程form表单基本信息表
 */
@MappedSuperclass
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Data
public class BaseFlowForm implements Serializable {

    private static final long serialVersionUID = 7904118892302876958L;

    @ApiModelProperty(value = "流程标题")
    @Column(name = "process_title", nullable = true, columnDefinition = "varchar(200) COMMENT '流程标题'")
    private String processTitle;

    @ApiModelProperty(value = "流程发起人")
    @Column(name = "create_operator", columnDefinition = "varchar(20) COMMENT '流程发起人'")
    private String createOperator;

    @ApiModelProperty(value = "流程发起人")
    @Column(name = "create_operator_name", columnDefinition = "varchar(20) COMMENT '流程发起人'")
    private String createOperatorName;

    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;
}
